<route lang="json5" type="page">
{
  layout: 'default',
  style: {
    navigationBarTitleText: '',
  },
}
</route>

<template>
  <view class="w-full">
    <web-view :src="src" @load="handleSuccessLoad" @error="handleErrorLoad" />
  </view>
</template>

<script lang="ts" setup>
const src = ref<string>('')
onLoad((query?: Record<string, string>) => {
  if (query?.src) {
    src.value = query.src
    console.log('src', src.value)
  }
})

// 加载成功
const handleSuccessLoad = () => {
  console.log('加载成功')
}

// 加载失败
const handleErrorLoad = () => {
  console.log('加载失败')
}
</script>

<style lang="scss" scoped>
//
</style>
